clear
set more off
set scheme s1color
cd ""
import delimited NCVS_PERSONAL_VICTIMIZATION_1993-2018.csv, clear /// Publicly available: https://www.bjs.gov/developer/ncvs/index.cfm.

keep if seriousviolent == 1 | seriousviolent == 2
collapse (sum) weight , by(year direl)
gen intimate = direl == 1
gen other_rel = direl == 2
gen acquant = direl == 3
gen stranger = direl == 4
foreach var in intimate other_rel acquant stranger {
    replace `var' = `var'*weight
}
collapse (sum) intimate other_rel acquant stranger, by(year)

label var intimate "Intimates"
label var other_rel "Other relatives"
label var acquant "Well-known/casual acquaintances"
label var stranger "Stranger"

graph twoway line intimate  year, lp(l) || line other_rel year, lp(-) || line acquant year, lp(_) || line stranger  year, lp(dash_dot)
graph export NCVS_vlnt_relationship_BY_year.eps, replace /// <- Figure A1 panel a.
